#pragma once
#include"HashTable.h"
namespace bao
{
	template<class K,class Hash= HashFunc<K>>
	class unordered_set
	{
	public:
		
		struct KeyOfT_unordered_set
		{
			const K& operator()(const K& key)
			{
				return key;
			}
		};
		typedef typename HashTable<K, const K, KeyOfT_unordered_set, Hash>::Itetator iterator;
		typedef typename HashTable<K, const K, KeyOfT_unordered_set, Hash>::Const_Itetator const_iterator;
		iterator begin()
		{
			return _hst.Begin();
		}
		iterator end()
		{
			return _hst.End();
		}
		const_iterator begin() const
		{
			return _hst.Begin();
		}
		const_iterator end() const
		{
			return _hst.End();
		}
		pair<iterator,bool> insert(const K& key)
		{
			return _hst.Insert(key);
		}
		iterator find(const K& key)
		{
			return _hst.Find(key);
		}
		bool erase(const K& key)
		{
			return _hst.Erase(key);
		}

	private:
		HashTable<K,const K, KeyOfT_unordered_set,Hash> _hst;
	};
}